/*
 * ComboBox.java  0.4.0 / Oct 26, 2010
 *
 * Copyright (c) 2010 - 2011, cute4j.com and contributors.
 *
 * This software is licensed under the LGPL version 2.1 license.
 * A copy of this license is included in the file LICENSE-LGPL.txt.
 */
package com.cute4j.swing;

import java.util.Vector;

/**
 * ComboBox Component.
 *
 * @author Slobodan Vrkacevic
 * @version 0.4.0
 */
public class ComboBox extends Component {

  // TODO: finish

// Static Initialization. ------------------------------------------------------

  static {
    _initialize();
  }

// Protected Fields. -----------------------------------------------------------

  protected ComboBoxModel dataModel;

// Public Constructors. --------------------------------------------------------

  /**
   * Constructs new ComboBox object.
   */
  public ComboBox() {
    this(new DefaultComboBoxModel());
  }

  /**
   * Constructs new ComboBox object.
   *
   * @param items the items
   */
  public ComboBox(Object[] items) {
    this(new DefaultComboBoxModel(items));
    if (items.length > 0) { // NOPMD - temp
      // TODO:  Implement setSelectedIndex
      //setSelectedIndex(0);
    }
  }

  /**
   * Constructs new ComboBox object.
   *
   * @param items the items
   */
  public ComboBox(Vector items) { // NOPMD
    this(new DefaultComboBoxModel(items));
    if (items.size() > 0) { // NOPMD - temp
      // TODO:  Implement setSelectedIndex
      //setSelectedIndex(0);
    }
  }

  /**
   * Constructs new ComboBox object.
   *
   * @param model the combo box model
   */
  public ComboBox(ComboBoxModel model) { // NOPMD
    super(false); // TODO: remove
    throw new RuntimeException("Not implemented");  // TODO Implement, NOPMD
    //this.dataModel = model;
  }

// Package-Private Native Methods. ---------------------------------------------

  native long _create();

  native void _setModel(long delegate, ComboBoxModel model);

// Private Static Native Methods. ----------------------------------------------

  private static native void _initialize();

}
